﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

namespace PrimaryAlgorithm.PlusOne
{
    class MainProject
    {
        static void Main(string[] args)
        {
            int[] nums = new int[] { 7, 2, 8, 5, 0, 9, 1, 2, 9, 5, 3, 6, 6, 7, 3, 2, 8, 4, 3, 7, 9, 5, 7, 7, 4, 7, 4, 9, 4, 7, 0, 1, 1, 1, 7, 4, 0, 0, 6};
            foreach (var item in PlusOne(nums))
            {
                Console.WriteLine(item);

            }
            Console.ReadKey();
        }
        public static int[] PlusOne(int[] digits)
        {
            string str = string.Empty;
            foreach (var item in digits)
            {
                str += item;
            }
            BigInteger strInt = BigInteger.Parse(str);
            strInt++;
            List<int> list = new List<int>();
            foreach (char item in strInt.ToString())
            {
                list.Add(int.Parse(item.ToString()));
            }
            return list.ToArray();
        }
    }
}
